package nextoffer.cainiao;

import java.util.Scanner;

public class FF {
    public static void main(String[] args) {

        int[][] res = new int[][]{{2,1},{4,2},{6,1},{8,3},{10,1}};
        Scanner in = new Scanner(System.in);
        int l ; int r ;
        l = in.nextInt();
        r = in.nextInt();

        int max = 0;
        if(l % 2!=0)l++;
        for(int i = l ; i <=r; i+=2){
            max = Math.max(max, res[i/2 - 1][1]);
        }
        System.out.println(max);
    }
}
